'''
Created on 2011-3-16

@author: Chine
'''

from django.conf.urls.defaults import *

from ChineKingBlog.blog.feeds import feed, ArticleFeed
from sitemap import ArticleSitemap

urlpatterns = patterns('ChineKingBlog.blog.views',
    url(r'^$', 'blog', name='program'),
    url(r'^page/(?P<page>\d+)/$', 'blog', name="program-page"),
    url(r'^article/(?P<slug>[-\w]+)/$', 'article', name='program-article'),
    url(r'^category/$', 'categories', name='program-categories'),
    url(r'^category/(?P<slug>\w+)/$', 'category', name='program-category'),
    url(r'^category/(?P<slug>\w+)/page/(?P<page>\d+)/$', 'category', name='program-category-page'),
    url(r'^tag/(?P<slug>[-\w]+)/$', 'tag', name='program-tag'),
    url(r'^tag/(?P<slug>[-\w]+)/page/(?P<page>\d+)/$', 'tag', name='program-tag-page'),
    url(r'^about/$', 'about', name='program-about'),
    url(r'^comment/add/$', 'comment', name='program-comment'),
    url(r'^comment/(?P<slug>[-\w]+)/$', 'comments', name='program-ajaxcomments'),
    url(r'^contact/$', 'contact', name='program-contact'),
    url(r'^contact/page/(?P<page>\d+)/$', 'contact', name="program-contact-page"),
    url(r'^message/add/$', 'message', name='program-message'),
    url(r'^search/$', 'search', name='program-search'),
    url(r'^email/$', 'email', name='program-email'),
    url(r'^log/$', 'log', name='program-log'),
    url(r'^logincheck/$', 'log_check', name='program-logcheck'),
    url(r'^logout/$', 'logout', name='program-logout'),
)

urlpatterns += patterns('',
    url(r'^rss/$', feed, name='program-rss'),
    url(r'^article/(?P<slug>[-\w]+)/rss/$', ArticleFeed, name='program-article-rss'),
)

urlpatterns += patterns('django.views.generic.simple',
    (r'^google2e923595853d61c0.html$', 'direct_to_template', {
        'template': 'blog/google2e923595853d61c0.html'
    }),
)

sitemaps = {  
    'article': ArticleSitemap,       
}

urlpatterns += patterns('',
    (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), 
)